<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/common.jsp" %>
<%@ include file="/common/grid/jqGrid.jsp" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="">
	<meta http-equiv="description" content="This is my page">
	
  </head>
  
  <body>
    <center>
    	<s:form name="frm" id="frm" method="post" action="" namespace="">
    		userId: <input type="text" id="userId" class="search" />
    		<input type="button" value="查询" class="btn" onclick="searchThis()" />
    		<table id="list" class="scroll" cellpadding="0" cellspacing="0"></table>
			<div id="pager" class="scroll" style="text-align:center;"></div>
    	</s:form>
    </center>
    
    <script type="text/javascript">
    $(document).ready(function(){
        var cName = new Array('Id','Username', 'Password', 'Department', '操作');
    	var cModel = [ {name:'id', index:'id', width:'20%', align:'center'},
                        {name:'username', index:'username', width:'20%', align:'center'},
                        {name:'password', index:'password', width:'30%', align:'center'},
                        {name:'deptName', index:'deptName', width:'20%', align:'center'},
                        {name:'id', index:'id', width:'10%', align:'center', sortable:false, formatter:option}
                      ];
        
        newJqGrid({
        	gridId: 'list',
        	pagerId: 'pager',
        	url: 'test/userManage.action',
        	head: cName,
        	column: cModel,
        	width: 700,
        	height: 'auto',
        	hasCb: true,
        	title: 'test grid',
        	rowClick: test
        });
    });
    
    function test(id)
    {
    	alert(id);
    }
    
    function option(id)
    {
    	return '<a href="javascript:toSee(\'' + id + '\')" >查看</a>';
    }
    
    function toSee(id)
    {
    	alert('hello ' + id);
    }
    
    function searchThis()
    {
    	var params = {'uvo.user.id':$('#userId').val()};
    	toSearchList('list', params);
    }
    </script>
  </body>
</html>
